//
//  main.m
//  oc_练习1
//
//  Created by blue on 16/4/13.
//  Copyright (c) 2016年 csx. All rights reserved.
//

#import "Complex.h"
#import "Student.h"
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {
       Complex *c1 = [[Complex alloc]initWithReal:2 andImaginary:3];
        
        Complex *c2=[[Complex alloc]initWithReal:4 andImaginary:5];
        
        //Complex *c3 = [Complex addAComplex:c1 andBComplex:c2];
        //Complex *c3 = [c1 addComplex:c2];
        
        //[Complex addAComplex:c1 andBComplex:c2];
        //[c3 printComplex];
        
        //NSLog(@"alksjf");
        
        /*NSArray创建不可变数组对象，数组是对象的有序集合
         数组存储的是对象的地址，对象的引用
        不可变数组一旦被创建，不可以继续添加、删除或者修改
         数组中的元素可以是不同类型的对象
         数组的访问是通过数组的下标0开始访问
        */
        
       /* NSArray *arr1 = @[@"one",@"two",@"three"];
       // NSLog(@"%@",arr1);
        
        
        NSArray *arr2 = [[NSArray alloc]init];
       // NSLog(@"%@",arr2);
        
        NSArray *arr3=[[NSArray alloc]initWithObjects:@"four",
        @"five",@"six",nil];
       // NSLog(@"%@",arr3);
        
        NSArray *arr4 = [[NSArray alloc]initWithArray:arr1];
       // NSLog(@"%@",arr4);
        
        NSArray *arr5 = [NSArray arrayWithObjects:@"seven",
                         @"eight",nil];
       // NSLog(@"%@",[arr5 firstObject]);
        
        
        
        NSArray *arr10 = @[@"one",@"two",@"three",@"five"];
        NSArray *arr11 = [[NSArray alloc]initWithObjects:
        @"eight",@"seven",@"six",nil];
      //  NSLog(@"%@",[arr11 firstObjectCommonWithArray:arr10]);
        
        
       NSArray *arr13 = [arr10 sortedArrayUsingSelector:@selector(compare:)];
        
        NSLog(@"%@",arr13);
        */
        
        Student *s1 = [[Student alloc]initWithName:@"成三" andAge:23 andDepartment:@"信息系"];
        Student *s2 = [[Student alloc]initWithName:@"李四" andAge:21 andDepartment:@"汽运系"];
        Student *s3 = [[Student alloc]initWithName:@"刘洋" andAge:25 andDepartment:@"经贸系"];
        
        NSArray *arr=[NSArray arrayWithObjects:s1,s2,s3, nil];
        
        NSArray *arr10 = @[@"one",@"two",@"three",@"five"];
        
       // for(int i=0;i<arr10.count;i++){
         //   NSLog(@"%@",arr10[i]);
        //}
        
        //for(NSString *str in arr10){
          //  NSLog(@"%@",str);
        //}
        
        
       /* NSEnumerator *e1 = [arr objectEnumerator];
        Student *obj;
        while(obj=(Student *)[e1 nextObject]){
            NSLog(@"%@",obj.name);
        }*/
        
        NSArray *arr21=[[NSArray alloc]init];
        arr21[0]=@"aaaaa";
        arr21[1]=@"bbbbb";
    }
    return 0;
}
